
const first = {
    id: 1001,
    name: '阿芳'
}

const second = {
    name: '李小芳',
    gender: '女士'
}

const third = {
    gender: 'female',
    age: 18
}

Object.defineProperty(third, 'hometown', { value: '兰州' } );

const target = {
    age: 22
}
console.log( target );

// Object.assign(target, ...sources)
// 作用: 将所有可枚举的自有属性从一个或多个源对象复制到目标对象
// 返回: 返回目标对象(即assign函数第一个参数传入对象)
const fourth = Object.assign( target, first, second, third );
console.log( fourth === target ); // true
console.log( target );
console.log( Object.getOwnPropertyNames( target ) );